﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LibreriaGestion
{
	public class GeneradorInformesSimple : IGeneradorInforme
	{
		public GeneradorInformesSimple(IGestorAlmacen gestor, IVisorInforme visor)
		{
			this.Gestor = gestor;
			this.Visor = visor;
		}


		#region Miembros de IGeneradorInforme

		public IGestorAlmacen Gestor { get; set; }
		public IVisorInforme Visor { get; set; }

		public string generaInforme()
		{
			StringBuilder sb = new StringBuilder();
			foreach (var a in Gestor.getArticulosGestionados())
				sb.AppendLine(a.ToString());

			return sb.ToString();
		}

		public void muestraInforme()
		{
			Visor.muestraInforme(generaInforme());
		}
		#endregion
	}
}
